#include "citynode.h"


bool CityNode::operator==(const CityNode &node)
{
    return this->name == node.name || this->enName == node.enName;
}

CityNode::CityNode(QString name, QString enName,int x, int y)
{
    this->name = name;
    this->enName = enName;
    this->x = x;
    this->y = y;
}

CityNode::CityNode(QString name, QString enName, QString cityImg, int x, int y)
{
    this->name = name;
    this->enName = enName;
    this->cityImg = cityImg;
    this->x = x;
    this->y = y;
}

CityNode::~CityNode()
{
    if(nextCitys != nullptr){
        qDeleteAll(nextCitys->begin(), nextCitys->end());
        nextCitys->clear();
        delete nextCitys;
        nextCitys = nullptr;
    }

    if(xiaoweis != nullptr){
        qDeleteAll(xiaoweis->begin(), xiaoweis->end());
        xiaoweis->clear();
        delete xiaoweis;
        xiaoweis = nullptr;
    }
}



